<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.11"/>
<title>Kinetis Bootloader Host: options.h Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
  $(document).ready(initResizable);
  $(window).load(resizeHeight);
</script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
  $(document).ready(function() { init_search(); });
</script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectlogo"><img alt="Logo" src="nxp_logo_small.png"/></td>
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">Kinetis Bootloader Host
   &#160;<span id="projectnumber">2.0.0</span>
   </div>
   <div id="projectbrief">Host Tools for Kinetis devices</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.11 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Introduction</span></a></li>
      <li><a href="pages.html"><span>Related&#160;Pages</span></a></li>
      <li><a href="modules.html"><span>Modules</span></a></li>
      <li>
        <div id="MSearchBox" class="MSearchBoxInactive">
        <span class="left">
          <img id="MSearchSelect" src="search/mag_sel.png"
               onmouseover="return searchBox.OnSearchSelectShow()"
               onmouseout="return searchBox.OnSearchSelectHide()"
               alt=""/>
          <input type="text" id="MSearchField" value="Search" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)" 
               onblur="searchBox.OnSearchFieldFocus(false)" 
               onkeyup="searchBox.OnSearchFieldChange(event)"/>
          </span><span class="right">
            <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
          </span>
        </div>
      </li>
    </ul>
  </div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
$(document).ready(function(){initNavTree('apps_2elftosb_2common_2options_8h_source.html','');});
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div class="header">
  <div class="headertitle">
<div class="title">apps/elftosb/common/options.h</div>  </div>
</div><!--header-->
<div class="contents">
<div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno">    1</span>&#160;<span class="comment">// ****************************************************************************</span></div><div class="line"><a name="l00002"></a><span class="lineno">    2</span>&#160;<span class="comment">// ^FILE: options.h - option parsing classes</span></div><div class="line"><a name="l00003"></a><span class="lineno">    3</span>&#160;<span class="comment">//</span></div><div class="line"><a name="l00004"></a><span class="lineno">    4</span>&#160;<span class="comment">// ^DESCRIPTION:</span></div><div class="line"><a name="l00005"></a><span class="lineno">    5</span>&#160;<span class="comment">//    This file defines classes used to parse command-line options.</span></div><div class="line"><a name="l00006"></a><span class="lineno">    6</span>&#160;<span class="comment">//    Options may be parsed from an array of strings, or from any structure</span></div><div class="line"><a name="l00007"></a><span class="lineno">    7</span>&#160;<span class="comment">//    for which a corresponding option-iterator exists.</span></div><div class="line"><a name="l00008"></a><span class="lineno">    8</span>&#160;<span class="comment">//</span></div><div class="line"><a name="l00009"></a><span class="lineno">    9</span>&#160;<span class="comment">// ^HISTORY:</span></div><div class="line"><a name="l00010"></a><span class="lineno">   10</span>&#160;<span class="comment">//    03/06/92  Brad Appleton   &lt;bradapp@enteract.com&gt;   Created</span></div><div class="line"><a name="l00011"></a><span class="lineno">   11</span>&#160;<span class="comment">//</span></div><div class="line"><a name="l00012"></a><span class="lineno">   12</span>&#160;<span class="comment">//    03/23/93  Brad Appleton   &lt;bradapp@enteract.com&gt;</span></div><div class="line"><a name="l00013"></a><span class="lineno">   13</span>&#160;<span class="comment">//    - Added OptIstreamIter class</span></div><div class="line"><a name="l00014"></a><span class="lineno">   14</span>&#160;<span class="comment">//</span></div><div class="line"><a name="l00015"></a><span class="lineno">   15</span>&#160;<span class="comment">//    03/08/94  Brad Appleton   &lt;bradapp@enteract.com&gt;</span></div><div class="line"><a name="l00016"></a><span class="lineno">   16</span>&#160;<span class="comment">//    - Added Options::reset() member function</span></div><div class="line"><a name="l00017"></a><span class="lineno">   17</span>&#160;<span class="comment">//</span></div><div class="line"><a name="l00018"></a><span class="lineno">   18</span>&#160;<span class="comment">//    07/31/97  Brad Appleton   &lt;bradapp@enteract.com&gt;</span></div><div class="line"><a name="l00019"></a><span class="lineno">   19</span>&#160;<span class="comment">//    - Added PARSE_POS control flag and POSITIONAL return value</span></div><div class="line"><a name="l00020"></a><span class="lineno">   20</span>&#160;<span class="comment">//</span></div><div class="line"><a name="l00021"></a><span class="lineno">   21</span>&#160;<span class="comment">//    04/30/06  Chris Reed</span></div><div class="line"><a name="l00022"></a><span class="lineno">   22</span>&#160;<span class="comment">//    - Updated to modern C++ and STL</span></div><div class="line"><a name="l00023"></a><span class="lineno">   23</span>&#160;<span class="comment">//    - Converted comments to doxygen style</span></div><div class="line"><a name="l00024"></a><span class="lineno">   24</span>&#160;<span class="comment">// ^^**************************************************************************</span></div><div class="line"><a name="l00025"></a><span class="lineno">   25</span>&#160;</div><div class="line"><a name="l00026"></a><span class="lineno">   26</span>&#160;<span class="preprocessor">#ifndef _options_h</span></div><div class="line"><a name="l00027"></a><span class="lineno">   27</span>&#160;<span class="preprocessor">#define _options_h</span></div><div class="line"><a name="l00028"></a><span class="lineno">   28</span>&#160;</div><div class="line"><a name="l00029"></a><span class="lineno">   29</span>&#160;<span class="preprocessor">#ifdef USE_STDIO</span></div><div class="line"><a name="l00030"></a><span class="lineno">   30</span>&#160;<span class="preprocessor">#include &lt;stdio.h&gt;</span></div><div class="line"><a name="l00031"></a><span class="lineno">   31</span>&#160;<span class="preprocessor">#else</span></div><div class="line"><a name="l00032"></a><span class="lineno">   32</span>&#160;<span class="preprocessor">#include &lt;iostream&gt;</span></div><div class="line"><a name="l00033"></a><span class="lineno">   33</span>&#160;<span class="preprocessor">#endif</span></div><div class="line"><a name="l00034"></a><span class="lineno">   34</span>&#160;</div><div class="line"><a name="l00037"></a><span class="lineno"><a class="line" href="class_opt_iter.html">   37</a></span>&#160;<span class="keyword">class </span><a class="code" href="class_opt_iter.html">OptIter</a></div><div class="line"><a name="l00038"></a><span class="lineno">   38</span>&#160;{</div><div class="line"><a name="l00039"></a><span class="lineno">   39</span>&#160;<span class="keyword">public</span>:</div><div class="line"><a name="l00040"></a><span class="lineno">   40</span>&#160;    <a class="code" href="class_opt_iter.html">OptIter</a>(<span class="keywordtype">void</span>) {}</div><div class="line"><a name="l00041"></a><span class="lineno">   41</span>&#160;    <span class="keyword">virtual</span> ~<a class="code" href="class_opt_iter.html">OptIter</a>(<span class="keywordtype">void</span>);</div><div class="line"><a name="l00042"></a><span class="lineno">   42</span>&#160;</div><div class="line"><a name="l00046"></a><span class="lineno">   46</span>&#160;    <span class="keyword">virtual</span> <span class="keyword">const</span> <span class="keywordtype">char</span> *<a class="code" href="class_opt_iter.html#a83fee36a05864e23eebc91b251ac9743">curr</a>(<span class="keywordtype">void</span>) = 0;</div><div class="line"><a name="l00047"></a><span class="lineno">   47</span>&#160;</div><div class="line"><a name="l00049"></a><span class="lineno">   49</span>&#160;    <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="class_opt_iter.html#aa9b79aa55fa9e3cf948045ff2a59508c">next</a>(<span class="keywordtype">void</span>) = 0;</div><div class="line"><a name="l00050"></a><span class="lineno">   50</span>&#160;</div><div class="line"><a name="l00054"></a><span class="lineno">   54</span>&#160;    <span class="keyword">virtual</span> <span class="keyword">const</span> <span class="keywordtype">char</span> *<a class="code" href="class_opt_iter.html#a039ef9ac21ffb563eedbc76cd42c5e02">operator()</a>(<span class="keywordtype">void</span>);</div><div class="line"><a name="l00055"></a><span class="lineno">   55</span>&#160;};</div><div class="line"><a name="l00056"></a><span class="lineno">   56</span>&#160;</div><div class="line"><a name="l00059"></a><span class="lineno"><a class="line" href="class_opt_iter_rwd.html">   59</a></span>&#160;<span class="keyword">class </span><a class="code" href="class_opt_iter_rwd.html">OptIterRwd</a> : <span class="keyword">public</span> <a class="code" href="class_opt_iter.html">OptIter</a></div><div class="line"><a name="l00060"></a><span class="lineno">   60</span>&#160;{</div><div class="line"><a name="l00061"></a><span class="lineno">   61</span>&#160;<span class="keyword">public</span>:</div><div class="line"><a name="l00062"></a><span class="lineno">   62</span>&#160;    <a class="code" href="class_opt_iter_rwd.html">OptIterRwd</a>(<span class="keywordtype">void</span>);</div><div class="line"><a name="l00063"></a><span class="lineno">   63</span>&#160;</div><div class="line"><a name="l00064"></a><span class="lineno">   64</span>&#160;    <span class="keyword">virtual</span> ~<a class="code" href="class_opt_iter_rwd.html">OptIterRwd</a>(<span class="keywordtype">void</span>);</div><div class="line"><a name="l00065"></a><span class="lineno">   65</span>&#160;</div><div class="line"><a name="l00066"></a><span class="lineno">   66</span>&#160;    <span class="keyword">virtual</span> <span class="keyword">const</span> <span class="keywordtype">char</span> *<a class="code" href="class_opt_iter.html#a83fee36a05864e23eebc91b251ac9743">curr</a>(<span class="keywordtype">void</span>) = 0;</div><div class="line"><a name="l00067"></a><span class="lineno">   67</span>&#160;</div><div class="line"><a name="l00068"></a><span class="lineno">   68</span>&#160;    <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="class_opt_iter.html#aa9b79aa55fa9e3cf948045ff2a59508c">next</a>(<span class="keywordtype">void</span>) = 0;</div><div class="line"><a name="l00069"></a><span class="lineno">   69</span>&#160;</div><div class="line"><a name="l00070"></a><span class="lineno">   70</span>&#160;    <span class="keyword">virtual</span> <span class="keyword">const</span> <span class="keywordtype">char</span> *<a class="code" href="class_opt_iter.html#a039ef9ac21ffb563eedbc76cd42c5e02">operator()</a>(<span class="keywordtype">void</span>) = 0;</div><div class="line"><a name="l00071"></a><span class="lineno">   71</span>&#160;</div><div class="line"><a name="l00073"></a><span class="lineno">   73</span>&#160;    <span class="keyword">virtual</span> <span class="keywordtype">void</span> rewind(<span class="keywordtype">void</span>) = 0;</div><div class="line"><a name="l00074"></a><span class="lineno">   74</span>&#160;};</div><div class="line"><a name="l00075"></a><span class="lineno">   75</span>&#160;</div><div class="line"><a name="l00079"></a><span class="lineno"><a class="line" href="class_opt_argv_iter.html">   79</a></span>&#160;<span class="keyword">class </span><a class="code" href="class_opt_argv_iter.html">OptArgvIter</a> : <span class="keyword">public</span> <a class="code" href="class_opt_iter_rwd.html">OptIterRwd</a></div><div class="line"><a name="l00080"></a><span class="lineno">   80</span>&#160;{</div><div class="line"><a name="l00081"></a><span class="lineno">   81</span>&#160;<span class="keyword">private</span>:</div><div class="line"><a name="l00082"></a><span class="lineno">   82</span>&#160;    <span class="keywordtype">int</span> ndx;               <span class="comment">// index of current arg</span></div><div class="line"><a name="l00083"></a><span class="lineno">   83</span>&#160;    <span class="keywordtype">int</span> ac;                <span class="comment">// arg count</span></div><div class="line"><a name="l00084"></a><span class="lineno">   84</span>&#160;    <span class="keyword">const</span> <span class="keywordtype">char</span> *<span class="keyword">const</span> *av; <span class="comment">// arg vector</span></div><div class="line"><a name="l00085"></a><span class="lineno">   85</span>&#160;</div><div class="line"><a name="l00086"></a><span class="lineno">   86</span>&#160;<span class="keyword">public</span>:</div><div class="line"><a name="l00087"></a><span class="lineno">   87</span>&#160;    <a class="code" href="class_opt_argv_iter.html">OptArgvIter</a>(<span class="keyword">const</span> <span class="keywordtype">char</span> *<span class="keyword">const</span> argv[])</div><div class="line"><a name="l00088"></a><span class="lineno">   88</span>&#160;        : av(argv)</div><div class="line"><a name="l00089"></a><span class="lineno">   89</span>&#160;        , ac(-1)</div><div class="line"><a name="l00090"></a><span class="lineno">   90</span>&#160;        , ndx(0)</div><div class="line"><a name="l00091"></a><span class="lineno">   91</span>&#160;    {</div><div class="line"><a name="l00092"></a><span class="lineno">   92</span>&#160;    }</div><div class="line"><a name="l00093"></a><span class="lineno">   93</span>&#160;</div><div class="line"><a name="l00094"></a><span class="lineno">   94</span>&#160;    <a class="code" href="class_opt_argv_iter.html">OptArgvIter</a>(<span class="keywordtype">int</span> argc, <span class="keyword">const</span> <span class="keywordtype">char</span> *<span class="keyword">const</span> argv[])</div><div class="line"><a name="l00095"></a><span class="lineno">   95</span>&#160;        : av(argv)</div><div class="line"><a name="l00096"></a><span class="lineno">   96</span>&#160;        , ac(argc)</div><div class="line"><a name="l00097"></a><span class="lineno">   97</span>&#160;        , ndx(0)</div><div class="line"><a name="l00098"></a><span class="lineno">   98</span>&#160;    {</div><div class="line"><a name="l00099"></a><span class="lineno">   99</span>&#160;    }</div><div class="line"><a name="l00100"></a><span class="lineno">  100</span>&#160;</div><div class="line"><a name="l00101"></a><span class="lineno">  101</span>&#160;    <span class="keyword">virtual</span> ~<a class="code" href="class_opt_argv_iter.html">OptArgvIter</a>(<span class="keywordtype">void</span>);</div><div class="line"><a name="l00102"></a><span class="lineno">  102</span>&#160;</div><div class="line"><a name="l00103"></a><span class="lineno">  103</span>&#160;    <span class="keyword">virtual</span> <span class="keyword">const</span> <span class="keywordtype">char</span> *<a class="code" href="class_opt_iter.html#a83fee36a05864e23eebc91b251ac9743">curr</a>(<span class="keywordtype">void</span>);</div><div class="line"><a name="l00104"></a><span class="lineno">  104</span>&#160;</div><div class="line"><a name="l00105"></a><span class="lineno">  105</span>&#160;    <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="class_opt_iter.html#aa9b79aa55fa9e3cf948045ff2a59508c">next</a>(<span class="keywordtype">void</span>);</div><div class="line"><a name="l00106"></a><span class="lineno">  106</span>&#160;</div><div class="line"><a name="l00107"></a><span class="lineno">  107</span>&#160;    <span class="keyword">virtual</span> <span class="keyword">const</span> <span class="keywordtype">char</span> *<a class="code" href="class_opt_iter.html#a039ef9ac21ffb563eedbc76cd42c5e02">operator()</a>(<span class="keywordtype">void</span>);</div><div class="line"><a name="l00108"></a><span class="lineno">  108</span>&#160;</div><div class="line"><a name="l00109"></a><span class="lineno">  109</span>&#160;    <span class="keyword">virtual</span> <span class="keywordtype">void</span> rewind(<span class="keywordtype">void</span>);</div><div class="line"><a name="l00110"></a><span class="lineno">  110</span>&#160;</div><div class="line"><a name="l00112"></a><span class="lineno"><a class="line" href="class_opt_argv_iter.html#aa92e7a667671e2dd77330142cbd9bf88">  112</a></span>&#160;    <span class="keywordtype">int</span> <a class="code" href="class_opt_argv_iter.html#aa92e7a667671e2dd77330142cbd9bf88">index</a>(<span class="keywordtype">void</span>) { <span class="keywordflow">return</span> ndx; }</div><div class="line"><a name="l00113"></a><span class="lineno">  113</span>&#160;};</div><div class="line"><a name="l00114"></a><span class="lineno">  114</span>&#160;</div><div class="line"><a name="l00117"></a><span class="lineno"><a class="line" href="class_opt_str_tok_iter.html">  117</a></span>&#160;<span class="keyword">class </span><a class="code" href="class_opt_str_tok_iter.html">OptStrTokIter</a> : <span class="keyword">public</span> <a class="code" href="class_opt_iter_rwd.html">OptIterRwd</a></div><div class="line"><a name="l00118"></a><span class="lineno">  118</span>&#160;{</div><div class="line"><a name="l00119"></a><span class="lineno">  119</span>&#160;<span class="keyword">private</span>:</div><div class="line"><a name="l00120"></a><span class="lineno">  120</span>&#160;    <span class="keywordtype">unsigned</span> len;     <span class="comment">// length of token-string</span></div><div class="line"><a name="l00121"></a><span class="lineno">  121</span>&#160;    <span class="keyword">const</span> <span class="keywordtype">char</span> *str;  <span class="comment">// the token-string</span></div><div class="line"><a name="l00122"></a><span class="lineno">  122</span>&#160;    <span class="keyword">const</span> <span class="keywordtype">char</span> *seps; <span class="comment">// delimiter-set (separator-characters)</span></div><div class="line"><a name="l00123"></a><span class="lineno">  123</span>&#160;    <span class="keyword">const</span> <span class="keywordtype">char</span> *cur;  <span class="comment">// current token</span></div><div class="line"><a name="l00124"></a><span class="lineno">  124</span>&#160;    <span class="keywordtype">char</span> *tokstr;     <span class="comment">// our copy of the token-string</span></div><div class="line"><a name="l00125"></a><span class="lineno">  125</span>&#160;</div><div class="line"><a name="l00126"></a><span class="lineno">  126</span>&#160;    <span class="keyword">static</span> <span class="keyword">const</span> <span class="keywordtype">char</span> *default_delims; <span class="comment">// default delimiters = whitespace</span></div><div class="line"><a name="l00127"></a><span class="lineno">  127</span>&#160;</div><div class="line"><a name="l00128"></a><span class="lineno">  128</span>&#160;<span class="keyword">public</span>:</div><div class="line"><a name="l00129"></a><span class="lineno">  129</span>&#160;    <a class="code" href="class_opt_str_tok_iter.html">OptStrTokIter</a>(<span class="keyword">const</span> <span class="keywordtype">char</span> *tokens, <span class="keyword">const</span> <span class="keywordtype">char</span> *delimiters = 0);</div><div class="line"><a name="l00130"></a><span class="lineno">  130</span>&#160;</div><div class="line"><a name="l00131"></a><span class="lineno">  131</span>&#160;    <span class="keyword">virtual</span> ~<a class="code" href="class_opt_str_tok_iter.html">OptStrTokIter</a>(<span class="keywordtype">void</span>);</div><div class="line"><a name="l00132"></a><span class="lineno">  132</span>&#160;</div><div class="line"><a name="l00133"></a><span class="lineno">  133</span>&#160;    <span class="keyword">virtual</span> <span class="keyword">const</span> <span class="keywordtype">char</span> *<a class="code" href="class_opt_iter.html#a83fee36a05864e23eebc91b251ac9743">curr</a>(<span class="keywordtype">void</span>);</div><div class="line"><a name="l00134"></a><span class="lineno">  134</span>&#160;</div><div class="line"><a name="l00135"></a><span class="lineno">  135</span>&#160;    <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="class_opt_iter.html#aa9b79aa55fa9e3cf948045ff2a59508c">next</a>(<span class="keywordtype">void</span>);</div><div class="line"><a name="l00136"></a><span class="lineno">  136</span>&#160;</div><div class="line"><a name="l00137"></a><span class="lineno">  137</span>&#160;    <span class="keyword">virtual</span> <span class="keyword">const</span> <span class="keywordtype">char</span> *<a class="code" href="class_opt_iter.html#a039ef9ac21ffb563eedbc76cd42c5e02">operator()</a>(<span class="keywordtype">void</span>);</div><div class="line"><a name="l00138"></a><span class="lineno">  138</span>&#160;</div><div class="line"><a name="l00139"></a><span class="lineno">  139</span>&#160;    <span class="keyword">virtual</span> <span class="keywordtype">void</span> rewind(<span class="keywordtype">void</span>);</div><div class="line"><a name="l00140"></a><span class="lineno">  140</span>&#160;</div><div class="line"><a name="l00143"></a><span class="lineno"><a class="line" href="class_opt_str_tok_iter.html#ae529c947a35bfc50233379cb2c822a04">  143</a></span>&#160;    <span class="keyword">const</span> <span class="keywordtype">char</span> *<a class="code" href="class_opt_str_tok_iter.html#ae529c947a35bfc50233379cb2c822a04">delimiters</a>(<span class="keywordtype">void</span>) { <span class="keywordflow">return</span> seps; }</div><div class="line"><a name="l00144"></a><span class="lineno">  144</span>&#160;    <span class="keywordtype">void</span> delimiters(<span class="keyword">const</span> <span class="keywordtype">char</span> *delims) { seps = (delims) ? delims : default_delims; }</div><div class="line"><a name="l00145"></a><span class="lineno">  145</span>&#160;};</div><div class="line"><a name="l00146"></a><span class="lineno">  146</span>&#160;</div><div class="line"><a name="l00162"></a><span class="lineno"><a class="line" href="class_opt_istream_iter.html">  162</a></span>&#160;<span class="keyword">class </span><a class="code" href="class_opt_istream_iter.html">OptIstreamIter</a> : <span class="keyword">public</span> <a class="code" href="class_opt_iter.html">OptIter</a></div><div class="line"><a name="l00163"></a><span class="lineno">  163</span>&#160;{</div><div class="line"><a name="l00164"></a><span class="lineno">  164</span>&#160;<span class="keyword">private</span>:</div><div class="line"><a name="l00165"></a><span class="lineno">  165</span>&#160;    std::istream &amp;is;</div><div class="line"><a name="l00166"></a><span class="lineno">  166</span>&#160;    <a class="code" href="class_opt_str_tok_iter.html">OptStrTokIter</a> *tok_iter;</div><div class="line"><a name="l00167"></a><span class="lineno">  167</span>&#160;</div><div class="line"><a name="l00168"></a><span class="lineno">  168</span>&#160;    <span class="keywordtype">void</span> fill(<span class="keywordtype">void</span>);</div><div class="line"><a name="l00169"></a><span class="lineno">  169</span>&#160;</div><div class="line"><a name="l00170"></a><span class="lineno">  170</span>&#160;<span class="keyword">public</span>:</div><div class="line"><a name="l00171"></a><span class="lineno">  171</span>&#160;    <span class="keyword">static</span> <span class="keyword">const</span> <span class="keywordtype">unsigned</span> MAX_LINE_LEN;</div><div class="line"><a name="l00172"></a><span class="lineno">  172</span>&#160;</div><div class="line"><a name="l00173"></a><span class="lineno">  173</span>&#160;    <a class="code" href="class_opt_istream_iter.html">OptIstreamIter</a>(std::istream &amp;input);</div><div class="line"><a name="l00174"></a><span class="lineno">  174</span>&#160;</div><div class="line"><a name="l00175"></a><span class="lineno">  175</span>&#160;    <span class="keyword">virtual</span> ~<a class="code" href="class_opt_istream_iter.html">OptIstreamIter</a>(<span class="keywordtype">void</span>);</div><div class="line"><a name="l00176"></a><span class="lineno">  176</span>&#160;</div><div class="line"><a name="l00177"></a><span class="lineno">  177</span>&#160;    <span class="keyword">virtual</span> <span class="keyword">const</span> <span class="keywordtype">char</span> *<a class="code" href="class_opt_iter.html#a83fee36a05864e23eebc91b251ac9743">curr</a>(<span class="keywordtype">void</span>);</div><div class="line"><a name="l00178"></a><span class="lineno">  178</span>&#160;</div><div class="line"><a name="l00179"></a><span class="lineno">  179</span>&#160;    <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="class_opt_iter.html#aa9b79aa55fa9e3cf948045ff2a59508c">next</a>(<span class="keywordtype">void</span>);</div><div class="line"><a name="l00180"></a><span class="lineno">  180</span>&#160;</div><div class="line"><a name="l00181"></a><span class="lineno">  181</span>&#160;    <span class="keyword">virtual</span> <span class="keyword">const</span> <span class="keywordtype">char</span> *<a class="code" href="class_opt_iter.html#a039ef9ac21ffb563eedbc76cd42c5e02">operator()</a>(<span class="keywordtype">void</span>);</div><div class="line"><a name="l00182"></a><span class="lineno">  182</span>&#160;};</div><div class="line"><a name="l00183"></a><span class="lineno">  183</span>&#160;</div><div class="line"><a name="l00346"></a><span class="lineno"><a class="line" href="class_options.html">  346</a></span>&#160;<span class="keyword">class </span><a class="code" href="class_options.html">Options</a></div><div class="line"><a name="l00347"></a><span class="lineno">  347</span>&#160;{</div><div class="line"><a name="l00348"></a><span class="lineno">  348</span>&#160;<span class="keyword">private</span>:</div><div class="line"><a name="l00349"></a><span class="lineno">  349</span>&#160;    <span class="keywordtype">unsigned</span> explicit_end : 1; </div><div class="line"><a name="l00350"></a><span class="lineno">  350</span>&#160;    <span class="keywordtype">unsigned</span> optctrls : 7;     </div><div class="line"><a name="l00351"></a><span class="lineno">  351</span>&#160;    <span class="keyword">const</span> <span class="keywordtype">char</span> *<span class="keyword">const</span> *optvec; </div><div class="line"><a name="l00352"></a><span class="lineno">  352</span>&#160;    <span class="keyword">const</span> <span class="keywordtype">char</span> *nextchar;      </div><div class="line"><a name="l00353"></a><span class="lineno">  353</span>&#160;    <span class="keyword">const</span> <span class="keywordtype">char</span> *listopt;       </div><div class="line"><a name="l00354"></a><span class="lineno">  354</span>&#160;    <span class="keyword">const</span> <span class="keywordtype">char</span> *cmdname;       </div><div class="line"><a name="l00355"></a><span class="lineno">  355</span>&#160;</div><div class="line"><a name="l00356"></a><span class="lineno">  356</span>&#160;    <span class="keywordtype">void</span> check_syntax(<span class="keywordtype">void</span>) <span class="keyword">const</span>;</div><div class="line"><a name="l00357"></a><span class="lineno">  357</span>&#160;</div><div class="line"><a name="l00358"></a><span class="lineno">  358</span>&#160;    <span class="keyword">const</span> <span class="keywordtype">char</span> *match_opt(<span class="keywordtype">char</span> opt, <span class="keywordtype">int</span> ignore_case = 0) <span class="keyword">const</span>;</div><div class="line"><a name="l00359"></a><span class="lineno">  359</span>&#160;</div><div class="line"><a name="l00360"></a><span class="lineno">  360</span>&#160;    <span class="keyword">const</span> <span class="keywordtype">char</span> *match_longopt(<span class="keyword">const</span> <span class="keywordtype">char</span> *opt, <span class="keywordtype">int</span> len, <span class="keywordtype">int</span> &amp;ambiguous) <span class="keyword">const</span>;</div><div class="line"><a name="l00361"></a><span class="lineno">  361</span>&#160;</div><div class="line"><a name="l00362"></a><span class="lineno">  362</span>&#160;    <span class="keywordtype">int</span> parse_opt(<a class="code" href="class_opt_iter.html">OptIter</a> &amp;iter, <span class="keyword">const</span> <span class="keywordtype">char</span> *&amp;optarg);</div><div class="line"><a name="l00363"></a><span class="lineno">  363</span>&#160;</div><div class="line"><a name="l00364"></a><span class="lineno">  364</span>&#160;    <span class="keywordtype">int</span> parse_longopt(<a class="code" href="class_opt_iter.html">OptIter</a> &amp;iter, <span class="keyword">const</span> <span class="keywordtype">char</span> *&amp;optarg);</div><div class="line"><a name="l00365"></a><span class="lineno">  365</span>&#160;</div><div class="line"><a name="l00366"></a><span class="lineno">  366</span>&#160;<span class="keyword">public</span>:</div><div class="line"><a name="l00367"></a><span class="lineno"><a class="line" href="class_options.html#a455ec724e9fbd8a18cb85284a58774b5">  367</a></span>&#160;    <span class="keyword">enum</span> <a class="code" href="class_options.html#a455ec724e9fbd8a18cb85284a58774b5">OptCtrl</a></div><div class="line"><a name="l00368"></a><span class="lineno">  368</span>&#160;    {</div><div class="line"><a name="l00369"></a><span class="lineno"><a class="line" href="class_options.html#a455ec724e9fbd8a18cb85284a58774b5ac80091c11929729ec1ca25417ead7f82">  369</a></span>&#160;        DEFAULT = 0x00,    </div><div class="line"><a name="l00370"></a><span class="lineno"><a class="line" href="class_options.html#a455ec724e9fbd8a18cb85284a58774b5aa27d19fd885e8e7b3d135d5359bd5d92">  370</a></span>&#160;        ANYCASE = 0x01,    </div><div class="line"><a name="l00371"></a><span class="lineno"><a class="line" href="class_options.html#a455ec724e9fbd8a18cb85284a58774b5a6f2d4beb8bc96f0bca7e80e891491fdf">  371</a></span>&#160;        QUIET = 0x02,      </div><div class="line"><a name="l00372"></a><span class="lineno"><a class="line" href="class_options.html#a455ec724e9fbd8a18cb85284a58774b5aad39c5430f4ed9c9986b1debfefd7930">  372</a></span>&#160;        PLUS = 0x04,       </div><div class="line"><a name="l00373"></a><span class="lineno"><a class="line" href="class_options.html#a455ec724e9fbd8a18cb85284a58774b5aa9aa58c832936f4d901b1904d3ccbc47">  373</a></span>&#160;        SHORT_ONLY = 0x08, </div><div class="line"><a name="l00374"></a><span class="lineno"><a class="line" href="class_options.html#a455ec724e9fbd8a18cb85284a58774b5af1dd8a107767b5e3747466d7b6286f5f">  374</a></span>&#160;        LONG_ONLY = 0x10,  </div><div class="line"><a name="l00375"></a><span class="lineno">  375</span>&#160;        NOGUESSING = 0x20, </div><div class="line"><a name="l00377"></a><span class="lineno">  377</span>&#160;        PARSE_POS = 0x40   </div><div class="line"><a name="l00383"></a><span class="lineno">  383</span>&#160;    };</div><div class="line"><a name="l00391"></a><span class="lineno">  391</span>&#160;</div><div class="line"><a name="l00394"></a><span class="lineno"><a class="line" href="class_options.html#a39e2cec67d9659ada7fcb8a211223c73">  394</a></span>&#160;    <span class="keyword">enum</span> <a class="code" href="class_options.html#a39e2cec67d9659ada7fcb8a211223c73">OptRC</a></div><div class="line"><a name="l00395"></a><span class="lineno">  395</span>&#160;    {</div><div class="line"><a name="l00396"></a><span class="lineno">  396</span>&#160;        ENDOPTS = 0,</div><div class="line"><a name="l00397"></a><span class="lineno">  397</span>&#160;        BADCHAR = -1,</div><div class="line"><a name="l00398"></a><span class="lineno">  398</span>&#160;        BADKWD = -2,</div><div class="line"><a name="l00399"></a><span class="lineno">  399</span>&#160;        AMBIGUOUS = -3,</div><div class="line"><a name="l00400"></a><span class="lineno">  400</span>&#160;        POSITIONAL = -4</div><div class="line"><a name="l00401"></a><span class="lineno">  401</span>&#160;    };</div><div class="line"><a name="l00402"></a><span class="lineno">  402</span>&#160;</div><div class="line"><a name="l00403"></a><span class="lineno">  403</span>&#160;    <a class="code" href="class_options.html">Options</a>(<span class="keyword">const</span> <span class="keywordtype">char</span> *name, <span class="keyword">const</span> <span class="keywordtype">char</span> *<span class="keyword">const</span> optv[]);</div><div class="line"><a name="l00404"></a><span class="lineno">  404</span>&#160;</div><div class="line"><a name="l00405"></a><span class="lineno">  405</span>&#160;    <span class="keyword">virtual</span> ~<a class="code" href="class_options.html">Options</a>(<span class="keywordtype">void</span>);</div><div class="line"><a name="l00406"></a><span class="lineno">  406</span>&#160;</div><div class="line"><a name="l00408"></a><span class="lineno"><a class="line" href="class_options.html#a20f463d775bec67dbbfdaa2af371073f">  408</a></span>&#160;    <span class="keyword">const</span> <span class="keywordtype">char</span> *<a class="code" href="class_options.html#a20f463d775bec67dbbfdaa2af371073f">name</a>(<span class="keywordtype">void</span>)<span class="keyword"> const </span>{ <span class="keywordflow">return</span> cmdname; }</div><div class="line"><a name="l00410"></a><span class="lineno"><a class="line" href="class_options.html#a966da6b84e47b7709ba43e8086b43f5c">  410</a></span>&#160;    <span class="keywordtype">unsigned</span> <a class="code" href="class_options.html#a966da6b84e47b7709ba43e8086b43f5c">ctrls</a>(<span class="keywordtype">void</span>)<span class="keyword"> const </span>{ <span class="keywordflow">return</span> optctrls; }</div><div class="line"><a name="l00412"></a><span class="lineno"><a class="line" href="class_options.html#aa6beab96e1692d11866a54484f145d2f">  412</a></span>&#160;    <span class="keywordtype">void</span> <a class="code" href="class_options.html#aa6beab96e1692d11866a54484f145d2f">ctrls</a>(<span class="keywordtype">unsigned</span> newctrls) { optctrls = newctrls; }</div><div class="line"><a name="l00414"></a><span class="lineno"><a class="line" href="class_options.html#a0b329ebeeeb068b5f179fb434ae43e3a">  414</a></span>&#160;    <span class="keywordtype">void</span> <a class="code" href="class_options.html#a0b329ebeeeb068b5f179fb434ae43e3a">reset</a>(<span class="keywordtype">void</span>) { nextchar = listopt = NULL; }</div><div class="line"><a name="l00417"></a><span class="lineno">  417</span>&#160;    <span class="keywordtype">void</span> usage(std::ostream &amp;os, <span class="keyword">const</span> <span class="keywordtype">char</span> *positionals) <span class="keyword">const</span>;</div><div class="line"><a name="l00418"></a><span class="lineno">  418</span>&#160;</div><div class="line"><a name="l00447"></a><span class="lineno">  447</span>&#160;    <span class="keywordtype">int</span> <a class="code" href="class_opt_iter.html#a039ef9ac21ffb563eedbc76cd42c5e02">operator()</a>(<a class="code" href="class_opt_iter.html">OptIter</a> &amp;iter, <span class="keyword">const</span> <span class="keywordtype">char</span> *&amp;optarg);</div><div class="line"><a name="l00448"></a><span class="lineno">  448</span>&#160;</div><div class="line"><a name="l00453"></a><span class="lineno"><a class="line" href="class_options.html#a559f537279e0a2bd5f8468cb1159f7ce">  453</a></span>&#160;    <span class="keywordtype">int</span> <a class="code" href="class_options.html#a559f537279e0a2bd5f8468cb1159f7ce">explicit_endopts</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> explicit_end; }</div><div class="line"><a name="l00454"></a><span class="lineno">  454</span>&#160;};</div><div class="line"><a name="l00455"></a><span class="lineno">  455</span>&#160;</div><div class="line"><a name="l00456"></a><span class="lineno">  456</span>&#160;<span class="preprocessor">#endif </span><span class="comment">/* _options_h */</span><span class="preprocessor"></span></div><div class="ttc" id="class_opt_str_tok_iter_html"><div class="ttname"><a href="class_opt_str_tok_iter.html">OptStrTokIter</a></div><div class="ttdef"><b>Definition:</b> apps/elftosb/common/options.h:117</div></div>
<div class="ttc" id="class_options_html"><div class="ttname"><a href="class_options.html">Options</a></div><div class="ttdoc">parse command-line options </div><div class="ttdef"><b>Definition:</b> apps/elftosb/common/options.h:346</div></div>
<div class="ttc" id="class_opt_argv_iter_html"><div class="ttname"><a href="class_opt_argv_iter.html">OptArgvIter</a></div><div class="ttdef"><b>Definition:</b> apps/elftosb/common/options.h:79</div></div>
<div class="ttc" id="class_opt_str_tok_iter_html_ae529c947a35bfc50233379cb2c822a04"><div class="ttname"><a href="class_opt_str_tok_iter.html#ae529c947a35bfc50233379cb2c822a04">OptStrTokIter::delimiters</a></div><div class="ttdeci">const char * delimiters(void)</div><div class="ttdef"><b>Definition:</b> apps/elftosb/common/options.h:143</div></div>
<div class="ttc" id="class_opt_istream_iter_html"><div class="ttname"><a href="class_opt_istream_iter.html">OptIstreamIter</a></div><div class="ttdef"><b>Definition:</b> apps/elftosb/common/options.h:162</div></div>
<div class="ttc" id="class_options_html_a20f463d775bec67dbbfdaa2af371073f"><div class="ttname"><a href="class_options.html#a20f463d775bec67dbbfdaa2af371073f">Options::name</a></div><div class="ttdeci">const char * name(void) const </div><div class="ttdoc">name() returns the command name </div><div class="ttdef"><b>Definition:</b> apps/elftosb/common/options.h:408</div></div>
<div class="ttc" id="class_opt_argv_iter_html_aa92e7a667671e2dd77330142cbd9bf88"><div class="ttname"><a href="class_opt_argv_iter.html#aa92e7a667671e2dd77330142cbd9bf88">OptArgvIter::index</a></div><div class="ttdeci">int index(void)</div><div class="ttdoc">index returns the current index to use for argv[] </div><div class="ttdef"><b>Definition:</b> apps/elftosb/common/options.h:112</div></div>
<div class="ttc" id="class_opt_iter_html_a039ef9ac21ffb563eedbc76cd42c5e02"><div class="ttname"><a href="class_opt_iter.html#a039ef9ac21ffb563eedbc76cd42c5e02">OptIter::operator()</a></div><div class="ttdeci">virtual const char * operator()(void)</div><div class="ttdef"><b>Definition:</b> apps/elftosb/common/options.cpp:108</div></div>
<div class="ttc" id="class_opt_iter_html_aa9b79aa55fa9e3cf948045ff2a59508c"><div class="ttname"><a href="class_opt_iter.html#aa9b79aa55fa9e3cf948045ff2a59508c">OptIter::next</a></div><div class="ttdeci">virtual void next(void)=0</div><div class="ttdoc">next() advances to the next item. </div></div>
<div class="ttc" id="class_options_html_a39e2cec67d9659ada7fcb8a211223c73"><div class="ttname"><a href="class_options.html#a39e2cec67d9659ada7fcb8a211223c73">Options::OptRC</a></div><div class="ttdeci">OptRC</div><div class="ttdef"><b>Definition:</b> apps/elftosb/common/options.h:394</div></div>
<div class="ttc" id="class_opt_iter_rwd_html"><div class="ttname"><a href="class_opt_iter_rwd.html">OptIterRwd</a></div><div class="ttdef"><b>Definition:</b> apps/elftosb/common/options.h:59</div></div>
<div class="ttc" id="class_options_html_a559f537279e0a2bd5f8468cb1159f7ce"><div class="ttname"><a href="class_options.html#a559f537279e0a2bd5f8468cb1159f7ce">Options::explicit_endopts</a></div><div class="ttdeci">int explicit_endopts() const </div><div class="ttdef"><b>Definition:</b> apps/elftosb/common/options.h:453</div></div>
<div class="ttc" id="class_options_html_a966da6b84e47b7709ba43e8086b43f5c"><div class="ttname"><a href="class_options.html#a966da6b84e47b7709ba43e8086b43f5c">Options::ctrls</a></div><div class="ttdeci">unsigned ctrls(void) const </div><div class="ttdoc">ctrls() (with no arguments) returns the existing control settings </div><div class="ttdef"><b>Definition:</b> apps/elftosb/common/options.h:410</div></div>
<div class="ttc" id="class_options_html_aa6beab96e1692d11866a54484f145d2f"><div class="ttname"><a href="class_options.html#aa6beab96e1692d11866a54484f145d2f">Options::ctrls</a></div><div class="ttdeci">void ctrls(unsigned newctrls)</div><div class="ttdoc">ctrls() (with 1 argument) sets new control settings </div><div class="ttdef"><b>Definition:</b> apps/elftosb/common/options.h:412</div></div>
<div class="ttc" id="class_opt_iter_html_a83fee36a05864e23eebc91b251ac9743"><div class="ttname"><a href="class_opt_iter.html#a83fee36a05864e23eebc91b251ac9743">OptIter::curr</a></div><div class="ttdeci">virtual const char * curr(void)=0</div></div>
<div class="ttc" id="class_options_html_a455ec724e9fbd8a18cb85284a58774b5"><div class="ttname"><a href="class_options.html#a455ec724e9fbd8a18cb85284a58774b5">Options::OptCtrl</a></div><div class="ttdeci">OptCtrl</div><div class="ttdef"><b>Definition:</b> apps/elftosb/common/options.h:367</div></div>
<div class="ttc" id="class_options_html_a0b329ebeeeb068b5f179fb434ae43e3a"><div class="ttname"><a href="class_options.html#a0b329ebeeeb068b5f179fb434ae43e3a">Options::reset</a></div><div class="ttdeci">void reset(void)</div><div class="ttdoc">reset for another pass to parse for options </div><div class="ttdef"><b>Definition:</b> apps/elftosb/common/options.h:414</div></div>
<div class="ttc" id="class_opt_iter_html"><div class="ttname"><a href="class_opt_iter.html">OptIter</a></div><div class="ttdef"><b>Definition:</b> apps/elftosb/common/options.h:37</div></div>
</div><!-- fragment --></div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
  <ul>
    <li class="navelem"><a class="el" href="dir_96c2f84c885cff71a930b6845f88cdd3.html">elftosb</a></li><li class="navelem"><a class="el" href="dir_c476059e18722267e10e2fb2cca6f785.html">common</a></li><li class="navelem"><b>options.h</b></li>
    <li class="footer">Generated on Mon Mar 7 2016 16:49:50 for Kinetis Bootloader Host by
    <a href="http://www.doxygen.org/index.html">
    <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.11 </li>
  </ul>
</div>
</body>
</html>
